const md5 = require('md5');
const fs = require('fs');
const path = require('path');
var milt = require('../lib/upload');
// var path = require('path'); 
function index(router) {

    router.get('/gethtml', async (ctx) => {
        var obj = await ctx.gethtml({
                url: 'https://www.fanxianggendan.com/',
            })
        
        // ctx.gethtml({
        //     type:true,//捉取静态文件img/json/css/js type:true
        //     url:'http://www.fanxianggendan.com/js/swiper-3.4.2.jquery.min.js',
        //     func(err,res,$){
        //         console.log(res.body)
        //         ctx.fs.createWriteStream('./1.js').write(res.body);
        //     }
        // })
        console.log(obj.res.$)
        ctx.response.body = obj.res.body
    });
}
module.exports = index;
